﻿//3. Write a program to convert decimal numbers to their hexadecimal representation.


using System;
using System.Collections.Generic;

class DecimalToHexadecimal
{
    static void Main()
    {
        int decimalNumber = int.Parse(Console.ReadLine());
        Console.WriteLine(GetIntHexadecimalString(decimalNumber));
        Console.WriteLine(decimalNumber.ToString("X"));
    }
    static string GetIntHexadecimalString(int decimalNumber)
    {
        List<char> hexBit = new List<char>();
        int remainder = 0;

        while (decimalNumber != 0)
        {
            remainder = decimalNumber % 16;
            decimalNumber = decimalNumber / 16;

            switch (remainder)
            {
                case 10:
                    hexBit.Add('A');
                    break;
                case 11:
                    hexBit.Add('B');
                    break;
                case 12:
                    hexBit.Add('C');
                    break;
                case 13:
                    hexBit.Add('D');
                    break;
                case 14:
                    hexBit.Add('E');
                    break;
                case 15:
                    hexBit.Add('F');
                    break;
                default:
                    hexBit.Add(Convert.ToChar(remainder.ToString()));
                    break;
            }
        }
        hexBit.Add('x');
        hexBit.Add('0');
        char[] hexBitChar = new char[hexBit.Count];
        for (int i = 0; i < hexBit.Count; i++)
        {
            hexBitChar[i] = hexBit[hexBit.Count - 1 - i];
        }
        return new string(hexBitChar);
    }
}
